<?php
class Zend_Controller_Action_Helper_Nav extends Zend_Controller_Action_Helper_Abstract{
	
	public function getHeaderNav(){
		
		$view=$this->getActionController()->view;
		
		$myCache = Zend_Registry::get('myCache');
		
		$navArray = $myCache->load("pageHeaderNavArray");
		
		if(!$navArray){
		
			$navContent=file_get_contents(MY_ROOT.'/html/upload/nav/nav.txt');
			
			$navArray=array();
			
			if($navContent!=''){
				
				$navArray=json_decode($navContent,true);
				
			}
			
			Zend_Loader::loadClass('CArray');
			
			$navArray=CArray::array_sort($navArray,'order');
			
			$myCache->save($navArray,'pageHeaderNavArray');
		
		}
		
		$view->assign('navArray',$navArray);
		
	}
	
}
